/*
 * @Author: fengYM feng25321@163.com
 * @Date: 2023-10-09 10:11:51
 * @LastEditors: fengYM feng25321@163.com
 * @LastEditTime: 2023-10-13 10:39:19
 * @Description:首页和资讯api
 */
import { apiRequest } from "../utils/request";
//人脉广场
export function userFriendsSquare(): Promise<commonTypes.ApiResponse<myTypes.myFriendsList[]>> {
  return apiRequest({
    url: `/userFriends/square`,
    method: "get",
  });
}
//看过我，影响力
export function getBaseData() {
  return apiRequest({
    url: `/card/getBaseData`,
    method: "get",
  });
}
//热门动态（分页）
export function getMainPostList(data: any) {
  return apiRequest({
    url: `/userPost/getMainPostList`,
    method: "get",
    data,
  });
}
//工厂列表
export function findFactory(data: any) {
  return apiRequest({
    url: `/factory/findFactory`,
    method: "get",
    data,
  });
}
//工厂入驻
export function applyFactory(data: any) {
  return apiRequest({
    url: `/factory/apply`,
    method: "post",
    data,
  });
}
//获取工厂信息（查看自己申请的工厂）
export function getInfoFactory(data: any) {
  return apiRequest({
    url: `/factory/getInfo`,
    method: "get",
    data,
  });
}
//工厂入驻重新提交
export function modifyFactory(data: any) {
  return apiRequest({
    url: `/factory/modify`,
    method: "post",
    data,
  });
}
//工厂推荐（分页）
export function recommendFactory(data: any) {
  return apiRequest({
    url: `/factory/recommend`,
    method: "get",
    data,
  });
}
//点击行业查询工厂
export function industryFactoryList(data: any) {
  return apiRequest({
    url: `/factory/industryFactoryList`,
    method: "get",
    data,
  });
}
//热门工厂
export function getHotIndustry(): Promise<commonTypes.ApiResponse<HomeTypes.hotIndustry>> {
  return apiRequest({
    url: `/factory/getHotIndustry`,
    method: "get",
  });
}
//搜索工厂（分页）
export function searchFactory(data: any) {
  return apiRequest({
    url: `/factory/search`,
    method: "get",
    data,
  });
}
//搜索帖子动态（分页）
export function searchPost(data: any) {
  return apiRequest({
    url: `/userPost/searchPost`,
    method: "get",
    data,
  });
}

//获取工厂详情
export function getSearchInfo() {
  return apiRequest({
    url: `/factory/getSearchInfo`,
    method: "get",
  });
}
//获取历史消息
export function getHistory(data: any) {
  return apiRequest({
    url: `/chat/getHistory`,
    method: "post",
    data,
  });
}
//发送消息
export function sendMsg(data: any) {
  return apiRequest({
    url: `/chat/send`,
    method: "post",
    data,
  });
}
//获取好友聊天列表
export function getChatList() {
  return apiRequest({
    url: `/chat/getChatList`,
    method: "get",
  });
}
